package com.prawn.user.pojo;

import javax.persistence.Embeddable;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

/**
 * @Auther: zhy
 * @Date: 2019/7/22
 * @Description: 角色权限表主键
 */
public class RolePermissionPK implements Serializable {

    private String roleId;
    private String menuId;

    public RolePermissionPK() {
    }

    public RolePermissionPK(String roleId, String menuId) {
        this.roleId = roleId;
        this.menuId = menuId;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof RolePermissionPK)) return false;
        RolePermissionPK that = (RolePermissionPK) o;
        return Objects.equals(getRoleId(), that.getRoleId()) &&
                Objects.equals(getMenuId(), that.getMenuId());
    }

    @Override
    public int hashCode() {

        return Objects.hash(getRoleId(), getMenuId());
    }
}
